#include <stdio.h>

void swap_arr(int arr[], int sz)
{
	int left = 0;
	int right = sz-1;
	int tmp = 0;


	while(left<right)
	{
		while((left<right)&&(arr[left]%2==1))
		{
			left++;
		}
		while((left<right)&& (arr[right]%2==0))
		{
			right--;
		}
		if(left<right)
		{
			tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
		}
	}
}

int main()
{
    int arr[10] = {0,1,2,3,4,5,6,7,8,9};
    int sz = sizeof(arr) / sizeof(arr[0]); 
    swap_arr(arr,sz);
    int i = 0;
    for(i = 0; i < 10; i++)
    {
        printf("%d ", arr[i]);
    }
    return 0;
}